/*
    XTU OJ: 1178
    by: fifth_light
*/

#include <stdio.h>

typedef struct {
    int x;
    int y;
} point;

typedef struct {
    point a;
    point b;
} rect;

typedef struct {
    int top;
    int left;
    int right;
    int bottom;
} new_rect;

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

new_rect rect_conv(rect in) {
    new_rect out;
    out.top = MIN(in.a.y, in.b.y);
    out.bottom = MAX(in.a.y, in.b.y);
    out.left = MIN(in.a.x, in.b.x);
    out.right = MAX(in.a.x, in.b.x);
    return out;
}

int do_have_common(rect a, rect b) {
    new_rect na = rect_conv(a), nb = rect_conv(b);
    if (nb.right <= na.left || nb.left >= na.right || nb.bottom <= na.top || nb.top >= na.bottom) {
        return 0;
    } else {
        return 1;
    }
}

int main(void) {
    int t;
    scanf("%d", &t);
    for(int i = 0; i < t; i++) {
        rect rec_a;
        rect rec_b;
        scanf("%d%d%d%d", &rec_a.a.x, &rec_a.a.y, &rec_a.b.x, &rec_a.b.y);
        scanf("%d%d%d%d", &rec_b.a.x, &rec_b.a.y, &rec_b.b.x, &rec_b.b.y);
        puts(do_have_common(rec_a, rec_b) ? "Yes" : "No");
    }
    return 0;
}
